package com.sylli.oeuf.server.object.transferable;

public class PostResponseTO extends BasedTO {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5009910237583499778L;
	
	private int flag;
	
	private String param;
	
	public final static int POSTRESP_BATTLE_WIN_GAIN_LEVEL = 1011;
	
	public final static int POSTRESP_BATTLE_WIN = 1001;
	
	public final static int POSTRESP_BATTLE_LOSE = 1002;
	
	public final static int POSTRESP_BATTLE_DRAW = 1003;
	
	public final static int POSTRESP_CRITCAL = -100;
	
	public final static int POSTRESP_EXPECTED_ERROR = -1;
	
	public final static int POSTRESP_NOTHING = 0;
	
	public final static int POSTRESP_BATTLE = 1;
	
	public final static int POSTRESP_WARP = 2;
	
	public final static int POSTRESP_SHOP = 3;
	
	public final static int POSTRESP_NPC = 4;
	
	public PostResponseTO() {
		// for flex
		flag = POSTRESP_NOTHING;
		param = null;
	}
	
	public PostResponseTO(int _flag, String _param) {
		flag = _flag;
		param = _param;
	}
	
	public PostResponseTO(int _flag) {
		flag = _flag;
		param = null;
	}
	
	public void setResponseContent(int _flag, String _param) {
		flag = _flag;
		param = _param;
	}
	
	@Override
	public boolean equals(Object o) {
		if (o instanceof PostResponseTO) {
			PostResponseTO pr = (PostResponseTO) o;
			return pr.flag == flag
				&& pr.param.equals(param);
		}
		return false;
	}

	@Override
	public String toString() {
		return "PostResponse: flag=" + flag
			+ ", param=" + param;
	}

	public int getFlag() {
		return flag;
	}

	public void setFlag(int flag) {
		this.flag = flag;
	}

	public String getParam() {
		return param;
	}

	public void setParam(String param) {
		this.param = param;
	}

}
